const uploader = new(require("../../library/qiniu-uploader.js"))(@options("qiniu") || {
    "accessKey": "KC5_GkZ13cMwwLD2Bp-Ju5PsDrAQrXoyL3fRn2Ep",
    "secretKey": "2NvJvonZtoNYvvEK0gykAqrZDdpHoVnx6vXqDHO1",
    "bucket": "mewchan",
    "domain": "https://static.mewchan.com"
});

module.exports = function(lab) {
    return {
        "listPrefix": function(session, options) {
            if (!session.currentUser) {
                throw @lab.errors.not_login
            }
            return uploader.listPrefix(options)
        },
        "deleteBatch": function(session, deleteFiles) {
            if (!session.currentUser) {
                throw @lab.errors.not_login
            }
            return uploader.deleteBatch(deleteFiles)
        },
    }
}